package com.bawei.module_notice.http

import com.bawei.lib_net.NetModules
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import javax.inject.Qualifier
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
class AnnouncementModule {
    @Provides
    @Singleton
    @CommonMainApi
    fun provideMainApi(@NetModules.CommonRetrofit retrofit: Retrofit):AnnouncementApi{
        return retrofit.create(AnnouncementApi::class.java)
    }

    @Provides
    @Singleton
    @SignMainApi
    fun provideSignMainApi(@NetModules.SignRetrofit retrofit: Retrofit):AnnouncementApi{
        return retrofit.create(AnnouncementApi::class.java)
    }
    // NetModules.kt（检查 baseUrl 和网络拦截器）

    @Qualifier
    @Retention(AnnotationRetention.RUNTIME)
    annotation class CommonMainApi


    @Qualifier
    @Retention(AnnotationRetention.RUNTIME)
    annotation class SignMainApi

}

